//
//	CommentUserModel.swift
//
//	Create by 松 松 on 27/5/2019
//	Copyright © 2019. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation


open class CommentUserModel : NSObject, NSCoding{

	public var appCode : String?
	public var fromUserId : String?
	public var fromUserHead : String?
	public var fromUserName : String?
	public var isImpose : Int?
	public var mainTypeCode : String?
	public var mainTypeColor : String?
	public var toItemCode : String?

    public override init() {

    }

	/**
	 * Instantiate the instance using the passed dictionary values to set the properties values
	 */
    required public init(fromDictionary dictionary: [String:Any]){
		appCode = dictionary["appCode;"] as? String
		fromUserId = dictionary["fromUserId;"] as? String
		fromUserHead = dictionary["fromUserHead;"] as? String
		fromUserName = dictionary["fromUserName;"] as? String
		isImpose = dictionary["isImpose;"] as? Int
		mainTypeCode = dictionary["mainTypeCode;"] as? String
		mainTypeColor = dictionary["mainTypeColor;"] as? String
		toItemCode = dictionary["toItemCode;"] as? String
	}

	/**
	 * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
	 */
	func toDictionary() -> [String:Any]
	{
		var dictionary = [String:Any]()
		if appCode != nil{
			dictionary["appCode;"] = appCode
		}
		if fromUserId != nil{
			dictionary["fromUserId;"] = fromUserId
		}
		if fromUserHead != nil{
			dictionary["fromUserHead;"] = fromUserHead
		}
		if fromUserName != nil{
			dictionary["fromUserName;"] = fromUserName
		}
		if isImpose != nil{
			dictionary["isImpose;"] = isImpose
		}
		if mainTypeCode != nil{
			dictionary["mainTypeCode;"] = mainTypeCode
		}
		if mainTypeColor != nil{
			dictionary["mainTypeColor;"] = mainTypeColor
		}
		if toItemCode != nil{
			dictionary["toItemCode;"] = toItemCode
		}
		return dictionary
	}

    /**
    * NSCoding required initializer.
    * Fills the data from the passed decoder
    */
    @objc required public init(coder aDecoder: NSCoder)
	{
         appCode = aDecoder.decodeObject(forKey: "appCode;") as? String
         fromUserId = aDecoder.decodeObject(forKey: "fromUserId;") as? String
         fromUserHead = aDecoder.decodeObject(forKey: "fromUserHead;") as? String
         fromUserName = aDecoder.decodeObject(forKey: "fromUserName;") as? String
         isImpose = aDecoder.decodeObject(forKey: "isImpose;") as? Int
         mainTypeCode = aDecoder.decodeObject(forKey: "mainTypeCode;") as? String
         mainTypeColor = aDecoder.decodeObject(forKey: "mainTypeColor;") as? String
         toItemCode = aDecoder.decodeObject(forKey: "toItemCode;") as? String

	}

    /**
    * NSCoding required method.
    * Encodes mode properties into the decoder
    */
    @objc public func encode(with aCoder: NSCoder)
	{
		if appCode != nil{
			aCoder.encode(appCode, forKey: "appCode;")
		}
		if fromUserId != nil{
			aCoder.encode(fromUserId, forKey: "fromUserId;")
		}
		if fromUserHead != nil{
			aCoder.encode(fromUserHead, forKey: "fromUserHead;")
		}
		if fromUserName != nil{
			aCoder.encode(fromUserName, forKey: "fromUserName;")
		}
		if isImpose != nil{
			aCoder.encode(isImpose, forKey: "isImpose;")
		}
		if mainTypeCode != nil{
			aCoder.encode(mainTypeCode, forKey: "mainTypeCode;")
		}
		if mainTypeColor != nil{
			aCoder.encode(mainTypeColor, forKey: "mainTypeColor;")
		}
		if toItemCode != nil{
			aCoder.encode(toItemCode, forKey: "toItemCode;")
		}

	}

}
